package org.focusj.scala.matzh

import scala.Array

object Test1 {
    def unapply(s: String): Some[String] =
        Some(s.reverse)

    def main(args: Array[String]) {
        val p = """([0-9]+) ([a-z]+)""".r
        val a = Array(10)
        "99 ddd" match {
            case p(k, d) /**/ => println(k, d)
        }

        "abcdefg" match {
            case Test1(s) => println(s) //！！！回去体会一下
        }

        val (kk, vv) = BigInt(10) /% 3 //包含商和余数的对偶
        val Array(_1, _2, _*) = Array(1, 2, 3, 4, 5, 6)
        println((kk, vv))

        case class Concurry(value: Int, name: String)

        val fj = Concurry(10, "focusj")

        //中置表示法
        fj match {
            case v Concurry n => println(v, n) //== case Concurry(v, n)
        }
    }
}
